<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="format-detection" content="telephone=no">
		<title>修改密码</title>

		<!--CSS-->
		<link rel="stylesheet" href="plugins/layui/css/layui.css" />
		<link rel="stylesheet" href="css/style.css" />

		<!--JS-->
		<script type="text/javascript" src="plugins/layui/layui.js"></script>
		<script type="text/javascript" src="js/base.js"></script>
	</head>

	<body>
		<div class="layui-layout layui-layout-admin my-iframe-content">
			<form class="layui-form" action="#">
				<div class="layui-form-item">
					<div class="layui-input-block my-login-input">
						<input type="password" name="pwd" lay-verify="required|pass" placeholder="原始密码" class="layui-input" />
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-input-block my-login-input">
						<input type="password" name="pwd" id="pwd"  lay-verify="required|pass"  placeholder="新密码" class="layui-input" />
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-input-block my-login-input">
						<input type="password" name="pwd" lay-verify="required|pass|repass"  placeholder="重复密码" class="layui-input" />
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-input-block my-login-input">
						<button class="layui-btn my-btn" lay-submit="" lay-filter="demo1">立即提交</button>
					</div>
				</div>
			</form>
		</div>
	</body>
	<script type="text/javascript">
		layui.use(['form', 'layedit', 'laydate'], function() {
			var form = layui.form,
				$ = layui.jquery;
			form.verify({
				pass: [/(.+){6,12}$/, '密码必须6到12位'],
				repass: function(value) {
					//获取密码
					var pwd = $("#pwd").val();
					if(!new RegExp(pwd).test(value)) {
						return '两次密码不一致';
					}
				}
			});
		});
	</script>

</html>